extract ints from strings in Pandas

43

extract ints from strings in Pandas -

df['B'].str.extract('(\d+)').astype(int)

extract integer from a string in pandas -

df['B'].str.extract('(\d+)').astype(int)

Comments

Submit
0 Comments